/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.biz.rest;

import me.zhengjie.annotation.Log;
import me.zhengjie.modules.biz.domain.JuniorDict;
import me.zhengjie.modules.biz.domain.req.JuniorDictListReq;
import me.zhengjie.modules.biz.service.JuniorDictService;
import me.zhengjie.modules.biz.domain.vo.JuniorDictQueryCriteria;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.zhengjie.utils.PageResult;

import javax.validation.Valid;

/**
* @author yiwei.he
* @date 2024-06-18
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "专科指导管理")
@RequestMapping("/api/juniorDict")
public class JuniorDictController {

    private final JuniorDictService juniorDictService;

    @PostMapping
    @Log("查询专科指导")
    @ApiOperation("查询专科指导")
    public ResponseEntity<PageResult<JuniorDict>> queryJuniorDict(@RequestBody JuniorDictQueryCriteria criteria){
        return new ResponseEntity<>(juniorDictService.queryAll(criteria,criteria.getPage()),HttpStatus.OK);
    }

    @PostMapping("/list")
    @Log("查询专科指导-专业/院校 列表")
    @ApiOperation("专科指导 - 专业/院校 列表")
    public ResponseEntity<PageResult<String>> professionList(@RequestBody @Valid JuniorDictListReq req){
        return new ResponseEntity<>(juniorDictService.professionList(req,req.getPage()),HttpStatus.OK);
    }


}
